package com.tm.springboot1.service.impl;

import com.tm.springboot1.mapper.StudentMapper;
import com.tm.springboot1.pojo.Student;
import com.tm.springboot1.service.StudentService;
import com.tm.springboot1.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @program: springboot1
 * @description: java
 * @author: 小仝
 * @create: 2023-04-10 20:26
 **/

@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentMapper studentMapper;

    @Override
    public Result findAll(Integer AId) {
        Student student = studentMapper.findAll(AId);
        return new Result(200,"查询学生信息成功",student);
    }

    @Override
    public Result insert(Student student) {
        Integer insert = studentMapper.insert(student);
        return new Result(200,"增加学生信息成功",insert);
    }

    @Override
    public Result update(Student student) {
        Integer update = studentMapper.update(student);
        return new Result(200,"修改学生信息成功",update);
    }

    @Override
    public Result delete(Integer Aid) {
        Integer delete = studentMapper.delete(Aid);
        return new Result(200,"删除学生信息成功",delete);
    }
}
